<?php
class ExcelExport
{
	static $xls_exporter = false;
	
	static function export($file_export, $content_theme)
	{
		if(!self::$xls_exporter)
		{
			require_once(ROOT_PATH . 'includes/html_to_xls.inc.php');
			self::$xls_exporter = new HTML_TO_XLS();
			
			$excel_css   = file_get_contents(ROOT_PATH.'style/excel.css');
	
			self::$xls_exporter->setCSS(str_replace("\r\n",'',$excel_css));
		}
		
		
		self::$xls_exporter->createXls($content_theme,$file_export, true);
	}
	
	#Example theme content:
	/*
	 $content_theme = '<Table x:FullColumns="1" x:FullRows="1">
	  <Row>
		<Cell ss:StyleID="s23"><Data ss:Type="String">ID</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Họ Tên</Data></Cell>
	    <Cell ss:StyleID="s23"><Data ss:Type="String">Email</Data></Cell>
	    <Cell ss:StyleID="s23"><Data ss:Type="String">Home phone</Data></Cell>
	    <Cell ss:StyleID="s23"><Data ss:Type="String">Mobile phone</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Gói dịch vụ</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Kiểu ĐKý</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Ngày đăng ký </Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Ngày bắt đầu</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Ngày kết thúc</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Trạng thái TT</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Kiểu TT</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Nhóm TT</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Thông tin TT</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Ngày TT</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Trạng thái</Data></Cell>
		<Cell ss:StyleID="s23"><Data ss:Type="String">Giá</Data></Cell>
	  </Row>
	  <Row>
		<Cell ss:StyleID="s21"><Data ss:Type="Number">1111</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">bbbbbb</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">ccccc</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">dddd</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">eeee</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">dddddd</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">fdfdfdfdf</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">fádf ádfádf </Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">fádfá dfádf</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">fá fádfa sdfádf</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">fá fádf</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">fa sdfádf</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">fa sfádf</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">f ádfádf</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">f ádfádf</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="String">gfđgâgsdg</Data></Cell>
		<Cell ss:StyleID="s21"><Data ss:Type="Number">444444</Data></Cell>
	  </Row>
	</Table>';
	*/
}
?>